home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.c,comp.lang.c.moderated
- Subject: option handling library - anyone, anyone?
- Date: 23 Mar 1996 11:01:58 -0600
- Organization: Usenet Fact Police (Undercover)
- Approved: seebs
- Message-ID: <4j1aq6$bnq@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- Summary: new option handling library
-
- I recently (well, ok, about 2 years ago) noticed that getopt() was not
- actually part of C. I mislike this, because I frequently wish to get
- command line options, but frequently wish to use machines which are not
- Unix-like enuogh to have getopt. So, I wrote my own. I believe this
- source to be portable; however, I don't have enough odd machines to
- prove anything.
-
- The library is available from my home page, under
- http://www.solon.com/~seebs/c/getopt.html
- or via ftp as
- ftp://taniemarie.solon.com/pub/c/ol-0.3.tar.gz
-
- There are doubtless bugs; the logic involved in parsing options like this
- is pretty hairy.
-
- The library has N+1 features, ranging from simple getopt()-like behavior
- through parsing complicated options, verifying that the provided values are
- legitimate, and other nonsense.
-
- Testers would be appreciated, and anyone interested is welcome to grab
- the code and use it, under GPL or Artistic license.
-
- If there is a positive response, I will start bundling and providing some
- of the other libraries I have, including my (presently mildly naive)
- linked list library.
-
- This was the first one to get documented, because I hope to use it with a
- project a coworker is doing, which will end up (probably) being portable to
- various damaged hardware (i.e., machines which need trigraphs), so I want to
- make sure it's as portable as possible. Note that the Makefile is not
- portable, but since all you need to do is compile the optlib.c file, and
- link it in with something, I assume the user can figure it out. :)
-
- I would claim it's strictly conforming, but since it calls malloc, and tests
- the result, it depends on implementation defined behavior. (Note: the bug
- that it doesn't always test the return value of malloc has been patched
- in my unreleased source tree.)
-
- (Is it cheating to call a library-built-from-a-single-module a source
- tree?)
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
- C/Unix wizard -- C/Unix questions? Send mail for help. No, really!
- FUCK the communications decency act. Goddamned government. [literally.]
- The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
-